<template>
  <div>
    <van-cell-group>
      <van-field v-model="name" label="文本" placeholder="请输入角色" />
      <van-field v-model="pid" label="文本" placeholder="请输入pid" />
      <van-button @click="addcole">添加角色</van-button>
    </van-cell-group>
  </div>
</template>
  
  <script>
export default {
  data() {
    return {
      name: "",
      pid: "",
    };
  },
  methods: {
    addcole() {
      var data = { name: this.name, pid: this.pid };
      this.axios.post("/addrole", data).then((res) => {
        console.log(res);
        alert(res.data.msg);
      });
    },
  },
};
</script>
  
  <style>
</style>